package com.attrisoft.sanger.aws;

import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class FileInfo {
    
    private static final SimpleDateFormat DFMT = new SimpleDateFormat("HH:mm MMM dd yyyy");
    private static NumberFormat NFMT = NumberFormat.getIntegerInstance();
    
    static {
        NFMT.setGroupingUsed(true);
    }
    
    private String name;
    private String size;
    private String modified;
    
    public FileInfo(String name, long size, Date modified) {
        this.name = name;
        this.size = NFMT.format(size);
        this.modified = DFMT.format(modified);
    }
    
    public String getName() {
        return name;
    }
    
    public String getSize() {
        return size;
    }

    public String getModified() {
        return modified;
    }

    @Override
    public String toString() {
        return "FileInfo [name=" + name + ", size=" + size + ", lastModified=" + modified + "]";
    }
}
